#ifndef OBJ_H
#define OBJ_H

#include "cocos2d.h"
#include "../../ugame/include/ugame.h"
#include "../../util/include/util.h"
#include <cmath>

USING_NS_CC;

using namespace ugame;

class Obj : public Ref {
protected:
    UG_PROPERTY_GETTER(int, objId, ObjId);
    UG_PROPERTY_FULL(Body*, body, Body);
    UG_PROPERTY_GETTER(__Array*, ranges, Ranges);
    UG_PROPERTY_GETTER(__Array*, faces, Faces);
public:
    Obj();
    ~Obj();
    void update(float dt);//update vi tri cac face theo body
    void setPosition(cocos2d::Point position);// set vi tri cua body
    cocos2d::Point getPosition();
    Face* getFace(char* faceName);//get tat ca cac faces cua obj
    void removeFace(char* faceName);//remove 1 face theo ten
    void setState(char* stateName, char* faceName);//thay doi state cua 1 face
};

#endif /* OBJ_H */
